<h2><?php echo $title; ?></h2>
<?php foreach($news as $news_item):?>
    <h3><?php echo $news_item['title'];?></h3>
    <div class="main">
        <?php echo $news_item['text'];?>
        <p><a href="<?php echo site_url("news/".$news_item["slug"]);?>">View articles</a></p>
    </div>
<?php endforeach;?>
<?php
/**
 * Created by PhpStorm.
 * User: Jackmao
 * Date: 2017/8/6
 * Time: 14:42
 */